/*
 * @Author        : wang chao
 * @Date          : 2024-03-19 14:06:30
 * @LastEditors: wangchao
 * @LastEditTime: 2024-10-08 10:11:03
 * @FilePath: \JD-RTT-Driver\applications\main.c
 * @Description   :
 * @Copyright     : Copyright 2024 wang chao, All Rights Reserved.
 */

#include "main.h"

void board_init(void)
{
    LOG_I("This K-Series BMS controller for SDDG");
    //
    LOG_I("System version:%d, Build time:%s", SYSTEM_VERSION, BUILD_TIMES);
    rt_thread_mdelay(100);
    system_func_params_init();
    rt_thread_mdelay(100);
    system_eth_net_init();
    LOG_I("Board init success.");
}

void main(void)
{
    board_init();
    //
    if (RT_EOK == bms_mbtcp_slave_on_serial_thread())
    {
        LOG_I("BMS HMI Communication Thread Startup.");
    }
    //
    if (RT_EOK == bms_volt_mbrtu_master_thread())
    {
        LOG_I("BMS Volt Board Communication Thread Startup.");
    }
    //
    if (RT_EOK == bms_pcs_mbtcp_master_thread())
    {
        LOG_I("BMS PCS Communication Thread Startup.");
    }

    if (RT_EOK == bms_device_rtu_master_thread())
    {
        LOG_I("BMS VFB Device Communication Thread Startup.");
    }
    //
    if (RT_EOK == bms_port_din_detect_thread())
    {
        LOG_I("BMS DI Detect Thread Startup.");
    }
    //
    if (RT_EOK == bms_ai_sensor_detect_thread())
    {
        LOG_I("BMS AI Sensor Detect  Thread Startup.");
    }
    //
    if (RT_EOK == bms_exception_event_thread())
    {
        LOG_I("BMS Exception Detect Thread Start-up.");
    }
    //
    app_core_runner();
}
